package com.effectiv.req1.domain;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Email;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.DBRef;
import org.springframework.data.mongodb.core.mapping.Document;

import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@ToString
@Document(collection="t_user")
@EqualsAndHashCode(exclude={"email","name","password","createdDate","lastUpdatedDate","company","roles"})
public class User implements Serializable{
	
	
	private static final long serialVersionUID = 1L;

	@Getter @Setter
	@Id
	private String id;
	
	@Email
	@Getter @Setter
	private String email;
	
	@NotNull
	@Getter @Setter
	private String name;
	@Getter @Setter
	private String password;
	@Getter @Setter
	private Date createdDate;
	@Getter @Setter
	private Date lastUpdatedDate;
	
	@Getter @Setter
	@DBRef
	private Company company;
	@Getter @Setter
	@DBRef
	private List<Lov> roles;
	
}
